package org.awenlice.playerdailyshop.network;

import net.minecraft.network.FriendlyByteBuf;
import net.minecraftforge.network.NetworkEvent;
import org.awenlice.playerdailyshop.gui.ShopGui;

import java.util.function.Supplier;

public class OpenSellShopPacket {
    public OpenSellShopPacket() {
    }

    public OpenSellShopPacket(FriendlyByteBuf buf) {
    }

    public void encode(FriendlyByteBuf buf) {
    }

    public void handle(Supplier<NetworkEvent.Context> context) {
        context.get().enqueueWork(() -> {
            // 在服务端打开商店界面
            if (context.get().getSender() != null) {
                ShopGui.open(context.get().getSender());
            }
        });
        context.get().setPacketHandled(true);
    }
}